#include <cmath>
#include <iomanip>
#include <iostream>

using namespace std;

class Point_3 {
   public:
    double x{}, y{}, z{};

    Point_3() = default;

    Point_3(double a, double b, double c) : x(a), y(b), z(c) {}

    virtual double getDis() { return sqrt(x * x + y * y + z * z); }

    virtual void showPos() {
        cout << fixed << setprecision(2) << x << " " << y << " " << z << endl;
    }
};

class Point_2 : public Point_3 {
   public:
    Point_2(double a, double b) {
        x = a;
        y = b;
        z = 0;
    }

    double getDis() override { return sqrt(x * x + y * y + z * z); }

    void showPos() override {
        cout << fixed << setprecision(2) << x << " " << y << endl;
    }
};

int main(int argc, char const* argv[]) {
    double x, y, a, b, c;
    while (cin >> x >> y) {
        Point_2 p1 = Point_2(x, y);
        cin >> a >> b >> c;
        Point_3 p2 = Point_3(a, b, c);

        cout << fixed << setprecision(2) << p1.getDis() << endl;
        p1.showPos();

        cout << fixed << setprecision(2) << p2.getDis() << endl;
        p2.showPos();
    }
}